package string;

public class StringBuilderDemo {
    public static void main(String[] args) {
        String str = "hello";
        StringBuilder builder = new StringBuilder(str);
        System.out.println(builder);

        builder.append(" world");
        System.out.println(builder);

        builder.replace(5, 6, "java");
        System.out.println(builder);

        builder.delete(5, 9);
        System.out.println(builder);

        builder.insert(5, "java");
        System.out.println(builder);

        builder.reverse();
        System.out.println(builder);
    }
}
